package com.yystar.support.base.typeeditor;

import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import org.apache.ibatis.type.JdbcType;

public class CustomBigDecimalTypeHandler extends org.apache.ibatis.type.BigDecimalTypeHandler {
	@Override
	public void setNonNullParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType) throws SQLException {
		BigDecimal colVal = new BigDecimal(((BigDecimal) parameter).toPlainString()) {
			private static final long serialVersionUID = 1L;

			public String toString() {
				return toPlainString();
			}
		};
		super.setNonNullParameter(ps, i, colVal, jdbcType);
	}
}
